import datetime
from applications.extensions import db


class Violation(db.Model):
    __tablename__ = 'admin_violation'
    id = db.Column(db.Integer, primary_key=True, comment='ID')
    title = db.Column(db.String(255), comment='标题')
    user_id = db.Column(db.String(255), comment='发布者id')
    username = db.Column(db.String(255), comment='发布者姓名')
    num = db.Column(db.Integer, default=0, comment='点击次数')
    commentnum = db.Column(db.Integer, default=0,comment='评论数量')
    sort = db.Column(db.Integer, comment='排序')
    enable = db.Column(db.Integer, comment='0：违规1:不违规')
    url = db.Column(db.Integer, comment='视频链接')
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='注册时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
